package com.example.qrcodelibrary.Utils;

import android.annotation.SuppressLint;

public class ThrowErrorException extends RuntimeException {

    private ErrorCode errorCode;

    public ThrowErrorException(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public ThrowErrorException(String message, ErrorCode errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public ThrowErrorException(String message, Throwable cause, ErrorCode errorCode) {
        super(message, cause);
        this.errorCode = errorCode;
    }

    public ThrowErrorException(Throwable cause, ErrorCode errorCode) {
        super(cause);
        this.errorCode = errorCode;
    }

    @SuppressLint("NewApi")
    public ThrowErrorException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, ErrorCode errorCode) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorCode = errorCode;
    }
}
